package enumtest.staticAndnormalTest;

/**
 * @author Administrator
 * 枚举反编译后 实现原理
 * 枚举书写 要求 必须将枚举常量写在枚举类的最开始
 */
public abstract class EnumOrigin {
	public static final EnumOrigin ENUMORIGINSON_1 = new EnumOriginSon_1();
	public static final EnumOrigin ENUMORIGINSON_2 = new EnumOriginSon_2();
	static final class EnumOriginSon_1 extends EnumOrigin{
		@Override
		public void f() {
			System.out.println("EnumOriginSon_1 f()");
		}
		@Override
		public void say() {
			System.out.println("EnumOriginSon_1 say()");
		}
		
	}
	static final class EnumOriginSon_2 extends EnumOrigin{
		@Override
		public void f() {
			System.out.println("EnumOriginSon_2 f()");
		}
	}
	{
		System.out.println("EnumOrigin block");
	}
	static{
		System.out.println("EnumOrigin static block");
	}
	public EnumOrigin() {
		System.out.println("EnumOrigin structrue");
	}
	public void say(){
		System.out.println("EnumOrigin say()");
	}
	public abstract void f();
}
